//C07:Swapping.cpp {-bor}
// All basic sequence containers can be swapped.
// {L} Noisy
#include <algorithm>
#include <deque>
#include <iostream>
#include <list>
#include <vector>
#include "Noisy.h"
#include "PrintContainer.h"
using namespace std;

template<class Cont>
void testSwap(char* cname)
{
    Cont c1, c2;
    generate_n(back_inserter(c1), 10, NoisyGen());
    generate_n(back_inserter(c2), 10, NoisyGen());
    cout << endl << cname << ":" << endl;
    print(c1, "c1");
    print(c2, "c2");

    cout << "\n Swapping the " << cname << ":" << endl;
    c1.swap(c2);
    print(c1, "c1"); 
    print(c2, "c2");
}

int main(void)
{
    testSwap<vector<Noisy>>("vector");
    testSwap<deque<Noisy>>("deque");
    testSwap<list<Noisy>>("list");
}